package com.springboot.demo.controller;

import com.springboot.demo.entity.User;
import com.springboot.demo.entity.po.SysCode;
import com.springboot.demo.entity.po.SysUser;
import com.springboot.demo.service.SysCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.*;

/**
 * @Description：
 * @Date： Created in 2021/12/27
 * @author： jianbin.lei
 * @Auto： <a href="mailto:493168771@qq.com">jianbin.lei</a>
 */
@Api(tags = {"6-数据字典管理","0-系统管理"})
@RestController
@RequestMapping(value = "/sysCode")     // 通过这里配置使下面的映射都在/users下
public class SysCodeController {

    @Autowired
    private SysCodeService sysCodeService;

    @GetMapping("/getSysCodeList")
    public List<SysCode> getSysCodeList(HttpServletRequest request ) {
        return sysCodeService.getList();
    }

    @GetMapping("/getSysCodeById")
    public SysCode getSysCodeById(HttpServletRequest request ,
                                           @ApiParam("字典Id主键") @RequestParam(required = true)  long id) {
        return sysCodeService.getSysCodeByDictCode(id);
    }


}
